//
//  TimerHelper.swift
//  ScanBleBtDeviceMac
//
//  Created by Caijinglong on 2017/9/11.
//

import Foundation

func runDelay(_ delay:TimeInterval,_ block:@escaping () -> ()){
    let queue = DispatchQueue.main
    
    let delayTime = DispatchTime.now() + delay
    
    queue.asyncAfter(deadline: delayTime) {
        block()
    }
}

func run(queue:DispatchQueue = DispatchQueue.main ,_ block:@escaping () -> ()){
    queue.async {
        block()
    }
}
